﻿using System;
using System.Data;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserControls_News_List : bzUCBase
{
    public DataTable dt = new DataTable();
    public string _CateID = "";
    public string NamCate = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        //_CateID = Request.QueryString["CateID"] == null ? "-1" : Request.QueryString["CateID"];
        //this.initSiteLang(bzSiteOption.Group.Limit, bzSiteOption.Note.NewsOne, bzLang.Note_NewsOne);
        //int limit = Convert.ToInt32(this.SiteOption["LimitItem_Service"]);
        //long total = new bzService().getTotal("", "1", "-1","-1");
        //this.loadPaginationReplaceURL(total, limit, bzStringClass.Root + "dich-vu");
        //dt = new bzService().getTable("", "1",this.PageNum.ToString(),limit.ToString(), "-1", _CateID);
        _CateID = Request.QueryString["CateID"] == null ? "-1" : Request.QueryString["CateID"];
        this.initSiteLang(bzSiteOption.Group.Limit, bzSiteOption.Note.NewsOne, bzLang.Note_NewsOne);
        int limit = Convert.ToInt32(this.SiteOption["LimitItem_News"]);
        long total = new bzService().getTotal("", "1", "-1", _CateID);
        DataTable dtCate = new bzServiceCate().getRecord(_CateID, "1");
        if (dtCate.Rows.Count > 0)
        {
            NamCate = " / " + dtCate.Rows[0]["Name" + this.CurrentLang].ToString();
        }
        if (Request.QueryString["Act"] == "List")
        {
            this.loadPaginationReplaceURL(total, limit, bzStringClass.Root + "dich-vu/danh-muc" + _CateID);
        }
        else
            this.loadPaginationReplaceURL(total, limit, bzStringClass.Root + "dich-vu");
        dt = new bzService().getTable("", "1", this.PageNum.ToString(), limit.ToString(), "-1", _CateID);
    }
}
